#include <iostream>
#include <string>
using namespace std;

static string  getCurrentTimeStr()
{
	time_t t = time(NULL);
	char ch[64] = {0};
	strftime(ch, sizeof(ch) - 1, "%Y-%m-%d %H:%M:%S", localtime(&t));     //年-月-日 时-分-秒


	return ch;
}


int main()
{

	cout << getCurrentTimeStr() << endl;

	string s;
    s = getCurrentTimeStr();

    cout << s << endl;
	return 0;
}